import React from "react";

export default React.memo(({ style, defaultValue, onChange }) => {
  const { position } = style;
  const __onChange = (ev) => {
    onChange && onChange(ev.target.value, `style.position`)
  }
  return (
    <div className="row form-item flex-center">
      <div className="col-8 form-item-label">
        <label>定位方式</label>
      </div>
      <div className={`col-16 form-item-control`}>
        <select className="cb-select" defaultValue={defaultValue} onChange={__onChange}>
          <option value="initial">默认</option>
          <option value="relative">相对定位</option>
          <option value="absolute">绝对定位</option>
          <option value="fixed">固定定位</option>
          <option value="inherit">继承父集</option>
          <option value="static">常规布局</option>
          <option value="sticky">粘性定位</option>
        </select>
      </div>
    </div>
  )
})